-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: DataFrame.reindex improve summary and return type #34584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: DataFrame.reindex improve summary and return type #34584
Conversation
Hello @gauravchandok! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-06-06 21:18:56 UTC |
While I'm reading your changes I realized there is more to this confusion than just the docstring. See #34663. The behavior of At the moment, I don't think this PR explains its behavior accurately. Let's discuss in #34663 what the desired outcome should be, which could be to deprecate |
@gauravchandok Can you merge master to fix conflicts? |
pandas/core/generic.py
Outdated
is produced unless the new index is equivalent to the current one and | ||
``copy=False``. | ||
Places NA/NaN in locations having no value in the previous index. A new | ||
DataFrame with an additional index is generated subject to customization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is generic, so could be Series/DataFrame
pandas/core/generic.py
Outdated
@@ -4286,7 +4286,7 @@ def reindex(self: FrameOrSeries, *args, **kwargs) -> FrameOrSeries: | |||
|
|||
Returns | |||
------- | |||
%(klass)s with changed index. | |||
%(klass)s with 2 indices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not correct, only 1 index is changed.
@@ -4239,11 +4239,11 @@ def sort_values( | |||
|
|||
def reindex(self: FrameOrSeries, *args, **kwargs) -> FrameOrSeries: | |||
""" | |||
Conform %(klass)s to new index with optional filling logic. | |||
Create an object with a new index and columns retained from %(klass)s. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not true, you can specify index and/or columns.
Places NA/NaN in locations having no value in the previous index. A new object | ||
is produced unless the new index is equivalent to the current one and | ||
``copy=False``. | ||
The values are only retained for index that matches in %(klass)s else NA/Nan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you say what the intent is here?
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
@gauravchandok Can you address comments and merge master? |
Closing for now. @gauravchandok ping us whenever you'd like to continue and we'll reopen! |
scripts/validate_docstrings.py pandas.DataFrame.reindex
)black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff